#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	int n, maxlen = 1, maxi = 0, maxj = 0;
	int a[55];
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf("%d", &a[i]);
	}
	for (int i = 0; i < n - 1; i++)
	{
		int tlen = 1, j = i + 1;
		while (a[j] == a[i])
		{
			tlen++;
			j++;
		}
		if (tlen > maxlen)
		{
			maxlen = tlen;
			maxi = i;
			maxj = j - 1;
		}

	}
	if (maxlen != 1) printf("%d,%d", maxi, maxj);
	else printf("NO");
	return 0;
}